<?php
/**
 * @package WordPress
 * @subpackage urbanmeandering
 */
?>
	<div id="comments">
	<?php 
	if ( post_password_required() ) 
	{ 
		?>
			<p class="nopassword"><?php _e( 'This post is password protected. Enter the password to view any comments.', 'twentyeleven' ); ?></p>
			</div><!-- #comments -->
		<?php
		return;
	}
	
	if ( have_comments() ) 
	{ 
		$comments_nav = get_comment_pages_count() > 1 && get_option( 'page_comments' ) ? true : false;
	
		?>
		<h2 id="comments-title">Discuss</h2>

		<?php 
		if ( $comments_nav ) 
		{ 
			?>
				<nav id="comment-nav-above">
					<h1 class="assistive-text"><?php _e( 'Comment navigation', 'twentyeleven' ); ?></h1>
					<div class="nav-previous"><?php previous_comments_link( __( '&larr; Older Comments', 'twentyeleven' ) ); ?></div>
					<div class="nav-next"><?php next_comments_link( __( 'Newer Comments &rarr;', 'twentyeleven' ) ); ?></div>
				</nav>
			<?php
		} ?>

		<ol class="commentlist">
			<?php	wp_list_comments( array( 'callback' => 'urbanmeandering_comment' ) );	?>
		</ol>

		<?php 
		if ( $comments_nav ) 
		{ 
			?>
				<nav id="comment-nav-below">
					<h1 class="assistive-text"><?php _e( 'Comment navigation', 'twentyeleven' ); ?></h1>
					<div class="nav-previous"><?php previous_comments_link( __( '&larr; Older Comments', 'twentyeleven' ) ); ?></div>
					<div class="nav-next"><?php next_comments_link( __( 'Newer Comments &rarr;', 'twentyeleven' ) ); ?></div>
				</nav>
			<?php 
		}
	}		
	elseif ( ! comments_open() && ! is_page() && post_type_supports( get_post_type(), 'comments' ) ) 
	{
		?>
			<p class="nocomments"><?php _e( 'Comments are closed.', 'twentyeleven' ); ?></p>
		<?php 
	} 
	
	comment_form(); ?>

</div><!-- #comments -->